package provatable;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the "MODULE" database table.
 * 
 */
@Entity
@Table(name="\"MODULE\"")
@NamedQuery(name="Module.findAll", query="SELECT m FROM Module m")
public class Module implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private long oid;

	private String moduleid;

	private String modulename;

	//bi-directional many-to-one association to Group
	@OneToMany(mappedBy="module")
	private List<Group> groups1;

	//bi-directional many-to-many association to Group
	@ManyToMany(mappedBy="modules")
	private List<Group> groups2;

	public Module() {
	}

	public long getOid() {
		return this.oid;
	}

	public void setOid(long oid) {
		this.oid = oid;
	}

	public String getModuleid() {
		return this.moduleid;
	}

	public void setModuleid(String moduleid) {
		this.moduleid = moduleid;
	}

	public String getModulename() {
		return this.modulename;
	}

	public void setModulename(String modulename) {
		this.modulename = modulename;
	}

	public List<Group> getGroups1() {
		return this.groups1;
	}

	public void setGroups1(List<Group> groups1) {
		this.groups1 = groups1;
	}

	public Group addGroups1(Group groups1) {
		getGroups1().add(groups1);
		groups1.setModule(this);

		return groups1;
	}

	public Group removeGroups1(Group groups1) {
		getGroups1().remove(groups1);
		groups1.setModule(null);

		return groups1;
	}

	public List<Group> getGroups2() {
		return this.groups2;
	}

	public void setGroups2(List<Group> groups2) {
		this.groups2 = groups2;
	}

}